package com.example.demo.enums;

public enum RoleEnum {

    WAREHOUSE_OPERATER(1,"warehouseOperater","仓库操作员"),

    CUSTOMER_SERVICE(2,"customerService","客服");

    int id;
    String roleCode;
    String roleName;

    RoleEnum(int id,String roleCode,String roleName) {
        this.id = id;
        this.roleCode = roleCode;
        this.roleName = roleName;
    }

    public int getId() {
        return id;
    }

    public String getRoleCode() {
        return roleCode;
    }

    public String getRoleName() {
        return roleName;
    }

    public static RoleEnum getRoleEnum(int roleId) {
        for (RoleEnum e : values()) {
            if(roleId == e.getId()) {
                return e;
            }
        }
        return null;
    }


}
